package com.onehouse.domain.room.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DailyRoomPriceSetEntity {
    
    private LocalDate date;
    private List<RoomPriceEntity> roomPrices;
    
    public void addRoomPriceEntity(RoomPriceEntity roomPriceEntity) {
        roomPrices.add(roomPriceEntity);
    }
    
    public RoomPriceEntity getRoomPriceByTypeId(Long roomTypeId) {
        return roomPrices.stream()
                .filter(price -> price.getRoomTypeId().equals(roomTypeId))
                .findFirst()
                .orElse(null);
    }
}